package com.minelx.sqlstructures.statements.clause;

import java.util.List;

// FIXME 2021/7/19  wait for me!!!     remove Serializable
public class Conditions {
	private static final String JOINER_AND = " AND ";

	public static Sql and(List<Sql> allSql) {
		return Sql.join(JOINER_AND, allSql);
	}

	public static String and2(List<String> allSql) {
		return String.join(JOINER_AND, allSql);
	}

	// FIXME 2021/6/21  wait for me!!!     turn to Collections with SqlValue -> Type
	public static Sql in(String fieldName, String value) {
		return () -> fieldName + " IN (" + value + ")";
	}

	public static Sql eq(String fieldName, String value) {
		return () -> fieldName + " = " + value;
	}

	public static Sql gt(String fieldName, String value) {
		return () -> fieldName + " > " + value;
	}

	public static Sql lt(String fieldName, String value) {
		return () -> fieldName + " < " + value;
	}
}
